﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class frame_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string name = txtName.Text.Trim();
        string password = txtPassword.Text.Trim();

        BLL.User bll = new BLL.User();
        Model.User user = bll.GetModelBystrWhere(string.Format(" UserName='{0}' ", name));
        if (user == null)
        {
            litMsg.Text = "*账号或密码错误！";
        }
        else
        {
            if (password.Equals(user.PassWord))
            {
                Session["user"] = user;
                //Response.Redirect("/user/default.aspx");
                //CnGine.Comm.MessageBox.RefreshOpener(this.Page);
                Comm.MessageBox.Script("parent.location.reload();");
            }
            else
            {
                litMsg.Text = "*账号或密码错误！";
            }
        }
    }

}